package org.gavin.core.exception;

import org.gavin.core.domain.Status;

/**
 * AccessDeniedException
 *
 * @author grl
 * @date 2024/1/25
 */
public class AccessException extends BaseException {

    public AccessException(String module, Integer code, Object args, String msg) {
        super(module,code,args,msg);
    }

    public static AccessException le(String module, Integer code, Object args, String msg){
        return new AccessException(module,code,args,msg);
    }

    public static <T extends Status> AccessException le(T status, String module, Object args ){
        return new AccessException(module,status.getCode(),args,status.getMsg());
    }

    public static <T extends Status> AccessException le(T status){
        return new AccessException(null,status.getCode(),null,status.getMsg());
    }
}
